<template>
	<view class="w-100 px-32" style="background-color: white;height: 600px;">
		<view class="zj-zero">
			<view class="direction">
				<image src="../static/webaddress.png" mode=""></image>
				<view class="u-f-24 u-m-t-18 no-text">请在浏览器中访问以下网站～</view>
			</view>
		</view>
		<view style="height: 80rpx;background:#8B8FF0;color:#FFFFFF;
		text-align: center;line-height: 80rpx;border-radius: 50rpx;margin: 30rpx;" @click="cpoy()">立即复制网址</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad() {

		},
		methods: {
			cpoy() {
				// console.log('开始复制')
				// // 创建一个临时的textarea元素
				// const text = 'http://admin.huanjushidai.cn/';
				// const elem = document.createElement('textarea');
				// document.body.appendChild(elem);
				// elem.value = text;
				// elem.select();
				// document.execCommand('copy');
				// document.body.removeChild(elem);
				// uni.showToast({
				// 	icon: 'none',
				// 	title: '文本已复制到剪贴板'
				// })
				// 设置系统剪贴板的内容
				uni.setClipboardData({
					data: 'http://admin.huanjushidai.cn/',
					success: () => {
						uni.showToast({
							title: '复制成功'
						})
					}
				})

			},
			goNav(e) {
				uni.navigateTo({
					url: e
				})
			},
			// 退出登录
			loginOut() {
				uni.showModal({
					title: '退出提醒',
					content: '确定要退出登录么',
					confirmColor: '#8B8FF0',
					success: e => {
						if (e.confirm) {
							this.avatar = '/static/images/logo.png';
							this.userName = '';
							// this.isLogin = false
							// 清除本地数据
							uni.removeStorageSync('token')
							uni.removeStorageSync('userName')
							uni.removeStorageSync('avatar')
							uni.removeStorageSync('phone')
							uni.removeStorageSync('invitationCode')
							uni.removeStorageSync('sex')
							uni.removeStorageSync('userId')
							uni.removeStorageSync('openId')
							uni.removeStorageSync('zhiFuBao')
							uni.removeStorageSync('zhiFuBaoName')
							uni.removeStorageSync('isVIP')
							uni.showToast({
								icon: 'none',
								title: '退出登录成功'
							})
							setTimeout(function() {
								uni.navigateBack()
							}, 1500)
						}
					}
				});
			}
		}

	}
</script>

<style>
</style>